feat: task tracker for session efficiency#3848
Conversation
katzdave
left a comment
There was a problem hiding this comment.
Cool! Will try it out some today.
|
|
||
| Ok(vec![Content::text(result)]) | ||
| } | ||
| "clear" => { |
| let tasks = self.tasks.lock().unwrap(); | ||
| let mut task_list = Vec::new(); | ||
| for (task, status) in tasks.iter() { | ||
| task_list.push(format!("{} [{}]", task, status.as_str())); |
There was a problem hiding this comment.
Should we filter completed tasks so this doesn't grow infinitely?
Maybe mark_task_done is a good place to do this? Remove all done tasks first, then mark the current task as done. Will keep a record then of the most recently completed task for some history but won't be too long running.
There was a problem hiding this comment.
yeah - it was either that or I expect the agent to clear tasks, btu yes, that is a good idea to make it clear up front
There was a problem hiding this comment.
I think it may be important for it to keep a list of what it has done over time - until it clears them all, the more I think about it (we can limit it though). The list shoudln't ever be that big or will have other troubles
There was a problem hiding this comment.
I guess was thinking that having too many completed tasks isn't relevant but yeah I think knowing what you did in the past might be helpful contex.
|
|
||
| #[derive(Debug, Clone)] | ||
| pub struct TaskTracker { | ||
| tasks: Arc<Mutex<HashMap<String, TaskStatus>>>, |
There was a problem hiding this comment.
Priority and size might be worth considering but seems reasonable to experiment with in a followup.
There was a problem hiding this comment.
size - could cap it/push back, but priority - you mean like an order?
There was a problem hiding this comment.
yeah like order; claude has high, medium and low.
|
|
||
| match action { | ||
| "list" => { | ||
| let tasks = self.list_tasks(); |
There was a problem hiding this comment.
Will experiment with how eager goose is to call this, but maybe we want to add some kind of mechanism to force this onto the end of every message (but not keep it in the context as a traditional message, so we're always presenting the latest state).
There was a problem hiding this comment.
hrm - that is an interesting to experiment with, I found with opus/sonnet it is reasonably happy to call it, but yes, that could be good.
One thing I would like to think about @katzdave: should we tweak the prompt so it doesn't ALWAYS use this, ie for non trivial one shot things should it not always call task tracker? I worry it could slow it down eg for some recipe like things, something to think about if you have any intuition there.
There was a problem hiding this comment.
this needs to be a platform tool and it should be a system prompt part
There was a problem hiding this comment.
as in go into the system prompt? the list should @Kvadratni ?
There was a problem hiding this comment.
tool descriptions usually do go in there already
|
@katzdave ready for another look - some tweaks/simplifying. For size - could include some cap now if you think needed? here it is kicking in after a compaction:
(and in that session, I started with something simple so it didn't kick in) |
|
I think this is better done in this location: #3902 - but should check out if fine grained is better. |

this is a follow on from: #3670
this adds a task tracker tool as part of the developer extension, which is useful when sessions are heavily summarized, these will remain and help keep things on track (but are ephemeral)
this may help address things like: #3841
take a look @katzdave